package pe.edu.upc.jtigers.svpn.domain.model;

import java.io.Serializable;
import java.util.Set;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.codehaus.jackson.annotate.JsonIgnore;

@Entity
@PrimaryKeyJoinColumn(name = "IdAdministrador")
public class Administrador extends Usuario implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = -3138869669838487287L;
	
	@Temporal(TemporalType.DATE)
	private Date ultimoIngreso;
	// Un administrador realiza 1 a muchos controles
	@JsonIgnore
	@OneToMany(mappedBy = "administrador", fetch = FetchType.LAZY)
	private Set<Control> controles;

	public Administrador() {
		super();
	}
	public Date getUltimoIngreso() {
		return ultimoIngreso;
	}

	public void setUltimoIngreso(Date ultimoIngreso) {
		this.ultimoIngreso = ultimoIngreso;
	}

	public Set<Control> getControles() {
		return controles;
	}

	public void setControles(Set<Control> controles) {
		this.controles = controles;
	}
}
